home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / text / hyper / ADtoHT2_0.lha / MyLib.lha / include / stdio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-18  |  2.0 KB  |  92 lines

  1. /* $VER: stdio.h 1.0 (02.03.95) */
  2.  
  3. #ifndef    _STDIO_H_
  4. #define    _STDIO_H_
  5.  
  6. #ifndef DOS_DOS_H
  7. #include <dos/dos.h>
  8. #endif
  9.  
  10. #ifndef DOS_STDIO_H
  11. #include <dos/stdio.h>
  12. #endif
  13.  
  14. #ifndef EXEC_LISTS_H
  15. #include <exec/lists.h>
  16. #endif
  17.  
  18. #ifndef _STDDEF_H_
  19. #include <stddef.h>
  20. #endif
  21.  
  22. #ifndef _AMIGA_H_
  23. #include <Amiga.h>
  24. #endif
  25.  
  26. typedef    struct __File
  27. {
  28.   struct MinNode Node;
  29.   BPTR Filehandle;
  30.   struct
  31.     {
  32.       unsigned int Error:1;    /* error was encountered */
  33.       unsigned int Eof:1;    /* eof was encountered */
  34.       unsigned int Close:1;    /* Close() on fclose() */
  35.       unsigned int Free:1;    /* free() on fclose() */
  36.     } Flags;
  37. } FILE;
  38.  
  39. #define    EOF        (-1)
  40.  
  41. #define    FOPEN_MAX    (3)
  42. #define    FILENAME_MAX    (256)
  43.  
  44. #define    SEEK_SET    OFFSET_BEGINNING
  45. #define    SEEK_CUR    OFFSET_CURRENT
  46. #define    SEEK_END    OFFSET_END
  47.  
  48. #define _IONBF    BUF_NONE
  49. #define _IOLBF    BUF_LINE
  50. #define _IOFBF    BUF_FULL
  51.  
  52. extern FILE __StdFiles[3];
  53.  
  54. #define    stdin    (&__StdFiles[0])
  55. #define    stdout    (&__StdFiles[1])
  56. #define    stderr    (&__StdFiles[2])
  57.  
  58. FILE *fopen (const char *, const char *);
  59. int fclose (FILE *);
  60. int setvbuf (FILE *, char *, int, size_t);
  61. int fflush (FILE *);
  62. void clearerr (FILE *);
  63. int feof (FILE *);
  64. int ferror (FILE *);
  65. BPTR fileno (FILE *);
  66. void perror (const char *);
  67. int vfprintf (FILE *, const char *, va_list);
  68. int vprintf (const char *, va_list);
  69. int vsprintf (char *, const char *, va_list);
  70. int sprintf (char *, const char *, ...);
  71. int printf (const char *, ...);
  72. int fprintf (FILE *, const char *, ...);
  73. int fgetc (FILE *);
  74. int ungetc (int, FILE *);
  75. int puts(const char *);
  76.  
  77. #define __feof(File)        (File->Flags.Eof)
  78. #define __ferror(File)        (File->Flags.Error)
  79. #define __clearerr(File)    ((void)(File->Flags.Error=File->Flags.Eof=0))
  80. #define __fileno(File)        (File->Filehandle)
  81.  
  82. #define    feof(File)        __feof(File)
  83. #define    ferror(File)        __ferror(File)
  84. #define    clearerr(File)        __clearerr(File)
  85. #define    fileno(File)        __fileno(File)
  86.  
  87. #define getc(File)    fgetc(File)
  88. #define    getchar()    getc(stdin)
  89. #define    putchar(x)    putc(x, stdout)
  90.  
  91. #endif /* _STDIO_H_ */
  92.